import random
import string
from threading import Thread
import sqlalchemy as sqla



def sql_insert():
    db = sqla.create_engine('mysql://root:Gerk087@&#@@192.144.235.125/test', encoding='utf-8', echo=True)

    # cur  = db.execute("select * from test")

    insert_sql = "insert into test (name,age,content) values ('mario',%s,%s)"

    for i in range(100000):
        age1 = random.randint(1, 100)
        str1 = ''.join(random.sample(string.ascii_letters, 6))

        db.execute(insert_sql, [age1, str1])


def main_thread():
    for i in range(100):
        Thread(target=sql_insert()).start()


if __name__ == '__main__':
    main_thread()